package org.yohailong.studyreactfrombilibili.pojo.response;

import lombok.Data;
import org.yohailong.studyreactfrombilibili.common.HttpConstants;

/**
 * @author 朱海龙
 * 2025/9/7 14:35
 */
@Data
public class Response<T> {

    private Boolean success;
    private String  errorCode;
    private String  errorMsg;
    private T       data;


    public static <T> Response<T> success(T data) {
        Response<T> response = new Response<>();
        response.setSuccess(true);
        response.setErrorCode(HttpConstants.success);
        response.setData(data);
        return response;
    }
}
